// gui/GuiHotSpotRect.h

#ifndef _GUI_GuiHotSpotRect_H_
#define _GUI_GuiHotSpotRect_H_

#ifndef _CORE_std_H_
#include <core/std.h>
#endif

#ifndef _GUI_GuiHotSpot_H_
#include "GuiHotSpot.h"
#endif

namespace GUI
{

class GuiHotSpotRect : public GuiHotSpot
{
public:

	enum EBounds
	{
		E_BOUNDS_LEFT = 0,
		E_BOUNDS_TOP,
		E_BOUNDS_RIGHT,
		E_BOUNDS_BOTTOM,

		E_BOUNDS_COUNT
	};

	GuiHotSpotRect();

	// Accessors
	float			GetLeft() const {
		return m_fRect[E_BOUNDS_LEFT];
	}
	float			GetRight() const {
		return m_fRect[E_BOUNDS_RIGHT];
	}
	float			GetTop() const {
		return m_fRect[E_BOUNDS_TOP];
	}
	float			GetBottom() const {
		return m_fRect[E_BOUNDS_BOTTOM];
	}

	void			SetRect( float fTLx, float fTLy, float fBRx, float fBRy );

	// APIs
	virtual bool	IsInside( float fX, float fY ) const;

private:

	float				m_fRect[E_BOUNDS_COUNT];
};

// inline Functions
inline GuiHotSpotRect::GuiHotSpotRect()
{
	m_fRect[E_BOUNDS_LEFT]	= 0.0f;
	m_fRect[E_BOUNDS_TOP]	= 0.0f;
	m_fRect[E_BOUNDS_RIGHT]	= 0.0f;
	m_fRect[E_BOUNDS_BOTTOM] = 0.0f;
}

inline void GuiHotSpotRect::SetRect( float fTLx, float fTLy, float fBRx, float fBRy )
{
	m_fRect[E_BOUNDS_LEFT]	= fTLx;
	m_fRect[E_BOUNDS_TOP]	= fTLy;
	m_fRect[E_BOUNDS_RIGHT]	= fBRx;
	m_fRect[E_BOUNDS_BOTTOM] = fBRy;
}

}; // namespace GUI

#endif // _GUI_GuiHotSpotRect_H_